import java.util.HashMap;
import java.util.Map;

class MyKeyTest {
	private Integer i;
	private String s;

	public MyKeyTest(Integer i, String s) {
		this.i = i;
		this.s = s;
	}

	@Override
	public int hashCode() {
		return i.hashCode() + 31 * s.hashCode();
	}

	@Override
	public boolean equals(Object o) {
		if (o == this)
			return true;
		if (o == null || !(o instanceof MyKeyTest))
			return false;
		MyKeyTest cp = MyKeyTest.class.cast(o);
		return i.equals(cp.i) && s.equals(cp.s);
	}

}

public class Rough {

	// hashmap look up based on a tuple
	public static void main(String[] args) {
		String t = "'Hello\\tWorld.\\nHai'".replace("\\","");
		System.out.println(t);
		
		String temp3 = "lambda:0:x:4".substring(0,7);
		System.out.print(temp3);
		
		String temp = "$$tau::2::<INT:2>::$$tau::2::<INT:7>::<INT:3>::$$::$$".substring(7);
		System.out.println(temp);
		String temp2 = temp.substring(temp.indexOf("::")+2);
		System.out.println(temp2);
		
		Map<Tuple, String> map = new HashMap<Tuple, String>();
		Tuple key1 = new Tuple(1, "Hello");
		Tuple key2 = new Tuple(1, "Hello");
		Tuple key3 = new Tuple(1, "Hello");
		map.put(key1, "world");
		map.put(key2, "digii");
		System.out.print("fish".hashCode());
		System.out.print("fish".hashCode());
		System.out.print(key2.hashCode());
		System.out.print(key3.hashCode());
		System.out.print(map.containsKey(key3));
		
		HashMap<TupleTest, String> h = new HashMap<TupleTest, String>();
		TupleTest abc = new TupleTest();
		abc.i = 0;
		abc.x = "fish";
		TupleTest ab = new TupleTest();
		ab.i = 0;
		ab.x = "fish";
		h.put(abc, "doggi");
		System.out.print(h.containsKey(ab));
		System.out.print("asd".hashCode());
		System.out.print("asd".hashCode());

		HashMap<String, String> hh = new HashMap<String, String>();
		hh.put("fish", "dolphin");
		hh.put("fish", "dolphin" + 2);
		System.out.print(h.containsKey("fish"));

	}

}

class TupleTest {
	int i;
	String x;

	public boolean equals(Object o) {
		return ((TupleTest) o).i == this.i && ((TupleTest) o).x.equals(this.x);
	}
	/*
	 * public int hashCode(){ return 0; }
	 */
}